package com.yuerenjf.yuerenjinfu.widget;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yuerenjf.yuerenjinfu.R;

/**
 * Created by Administrator on 2017/6/15 0015.
 */

public class ArcLayout extends LinearLayout{
    Context context;
    View view;
    private ArcProgress mArcProgress;
    private DinTextView mLastDayTv;
    private DinTextView mShouYiLvTv;
    private TextView mUnitTv;


    public ArcLayout(Context context) {
        super(context);
        this.context=context;
        init();
    }

    public ArcLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        this.context=context;
        init();
    }

    public ArcLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context=context;
        init();
    }
    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public ArcLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        init();
    }

    private void init(){
        View view = View.inflate(context, R.layout.layout_arc_progress, this);
        mArcProgress= (ArcProgress) view.findViewById(R.id.arc_progress);
        mShouYiLvTv= (DinTextView) view.findViewById(R.id.money);
        mLastDayTv= (DinTextView) view.findViewById(R.id.home_last_num_day_text);
        mUnitTv= (TextView) view.findViewById(R.id.arc_progress_unit_tv);

    }

    public void setmArcProgress(int progress){
        mArcProgress.setProgress(progress);
    }

    public void setShouYiLvTv(String money){
        mShouYiLvTv.setText(money);
    }
    public void setQiXianTv(String qiXian){
        mLastDayTv.setText(qiXian);
    }

    public void setmUnitTv(String qiXian){
        mUnitTv.setText(qiXian);
    }
}
